package huawei;

import java.util.Arrays;
import java.util.Map;

public class guessNumber {

    public static void main(String[] args) {
//        int[] ints = {30,11,23,4,20};
//        int needHours = 6;
        int[] ints = {2,3,4,5};
        int needHours = 0;

        if (needHours < ints.length) {
            System.out.println(0);
            return;
        }

        int max = 0;
        for (int i = 0; i < ints.length; i++) {
            max = Math.max(ints[i], max);
        }

        int l = 1, r = max;

        int res = Integer.MAX_VALUE;
        while (l <= r) {
            int mid = (l + r) / 2;  // 猜测能吃一小时吃mid个桃子
            int days = 0;
            for (int i = 0; i < ints.length; i++) {
                days += (ints[i] + mid - 1) / mid;
            }
            if (days > needHours) {
                l = mid + 1;
            } else {
                res = Math.min(res, mid);
                r = mid - 1;
            }
        }
        System.out.println(res == Integer.MAX_VALUE ? 0 : res);
    }


}
